package com.fengwk.support.util;

import com.fengwk.support.exception.BaseException;
import com.fengwk.support.util.LoggerUtils.Logger;

public class DataTypeUtils {
	
	private static final Logger LOG = LoggerUtils.getLogger(DataTypeUtils.class);

	private DataTypeUtils() {
		throw new BaseException("can not instance " + getClass());
	}
	
	public static Integer stringToInteger(String str) {
		Integer i = null;
		if(StringUtils.isNotBlank(str)) {
			try {
				i = new Integer(str);
			} catch (Exception e) {
			    LOG.error(e.getMessage());
			}
		}
		return i;
	}
	
	public static Long stringToLong(String str) {
		Long l = null;
		if(StringUtils.isNotBlank(str)) {
			try {
				l = new Long(str);
			} catch (Exception e) {
			    LOG.error(e.getMessage());
			}
		}
		return l;
	}
	
}
